import dsl.rulesengine.RulesEngineDelegator

def app = new LogicBuilder(PostLogic)

def post = new Post(name:'My Post')
//def post = new Post(name:'My Post', persistable: true)
//def post = new Post()

def hack = new RulesEngineDelegator()
hack.valid(post) {
    save(post)
    redirect(post)
}


app.valid(post) {
    save(post)
    redirect(post:post, target:'list')     
    //calling local methods breaks the order of events for the logic builder, we need a pathalogical builder!
    localMethod()
}
app.invalid(post) {
    render(post)
    localMethod()
}
app.foo()


def localMethod() {
    println('I would imagine this will cause some problems!')
}